//
//  testViewController.m
//  CargocnRun
//
//  Created by mac on 2018/12/10.
//  Copyright © 2018年 mac. All rights reserved.
//

#import "testViewController.h"
#import "test2ViewController.h"
@interface testViewController ()<UITableViewDelegate,UITableViewDataSource,UIScrollViewDelegate>
@property (nonatomic,strong) UITableView *tableView;
@property (nonatomic,strong) NSArray *dataArray;
@property (nonatomic,assign) NSInteger num;

@end

@implementation testViewController

-(void)viewWillAppear:(BOOL)animated
{
    //    self.navigationController.navigationBar.hidden = NO;
        [self addNaviBarColor];
        [self addBackNaviLeftItem];
    //    [self addHomePageNaviRightItemByImg:@"tab0"];
//    self.navigationItem.title = @"首页";
//    self.navigationController.navigationBar.prefersLargeTitles = YES;//这句话表示是否显示大标题
//    self.navigationItem.largeTitleDisplayMode =  UINavigationItemLargeTitleDisplayModeAutomatic;//这个是标题显示的方式，下面会详细的说
    //    [self.navigationController.navigationBar setLargeTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor whiteColor], NSForegroundColorAttributeName,[UIFont systemFontOfSize:18.0f],NSFontAttributeName,nil]];
    //    [self.navigationItem addRightItemTarget:self action:@selector(togogooo) andImageName:@"tab0" andSize:CGSizeMake(40, 40)];
}
-(void)togogooo
{
    self.dataArray = @[@"1",@"22",@"333",@"444",@"555",@"666",@"666",@"777",@"888",@"999",@"000",@"999",@"999",@"000",@"999",@"999",@"000",@"999",@"999",@"000",@"999",@"999",@"000",@"999",@"999",@"000",@"999",@"999",@"000",@"999",@"999",@"000",@"999",@"999",@"000",@"999",@"999",@"000",@"999",@"999",@"000",@"999",@"999",@"000",@"999",@"999",@"000",@"999",@"999",@"000",@"999",@"999",@"000",@"999",@"999",@"000",@"999"];
    [self.tableView reloadData];
}

- (void)viewDidLoad {
    self.dataArray = @[@"11",@"212",@"3331",@"4441",@"5551",@"6661",@"6661",@"7771",@"8881",@"9991",@"0001",@"9991",@"22",@"333",@"444",@"555",@"666",@"22",@"333",@"444",@"555",@"666",@"22",@"333",@"444",@"555",@"666",@"22",@"333",@"444",@"555",@"666",@"22",@"333",@"444",@"555",@"666",@"22",@"333",@"444",@"555",@"666",@"22",@"333",@"444",@"555",@"666"];
    self.title = @"我是标题";
    [super viewDidLoad];
    //    self.view.backgroundColor = [UIColor redColor];
    self.num = 30;
    ILog(@"%f---%f",40*ScaleRate*self.num,40*ScaleRate);
    self.tableView = [[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStylePlain];
    self.tableView.delegate = self;
    self.tableView.dataSource = self;
    [self.view addSubview:self.tableView];
    
    
    UIButton *BTN = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, ScreenWidth, 40)];
    [BTN setTitle:@"我是按钮" forState:UIControlStateNormal];
    [BTN setBackgroundColor:KBLUECOLOR];
    //    BTN.alpha = 0.2;
    [BTN addTarget:self action:@selector(topush) forControlEvents:UIControlEventTouchUpInside];
    //    [self.view addSubview:BTN];
}
-(void)topush
{
    test2ViewController *wallet = [[test2ViewController alloc] init];
    self.hidesBottomBarWhenPushed = YES;
    [self.navigationController pushViewController:wallet animated:YES];
    self.hidesBottomBarWhenPushed = YES;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    NSString *identifier = @"Indentifier";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier];
    if (!cell) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifier];
    }
    cell.accessoryType=UITableViewCellAccessoryDisclosureIndicator;
    cell.textLabel.text = [self.dataArray objectAtIndex:indexPath.row];
    return cell;
    
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return self.dataArray.count;
}
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return 40*ScaleRate;
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    [self topush];
}

@end
